<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" type="text/css" href="__CSS__/main.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/common.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.min.css" />
    <link href="//cdn.bootcss.com/bootstrap-validator/0.5.3/css/bootstrapValidator.min.css" rel="stylesheet">
    <script src="//cdn.bootcss.com/bootstrap-validator/0.5.3/js/bootstrapValidator.min.js"></script>
    <!-- <link rel="stylesheet" type="text/css" href="__EXTEND__/static/h-ui.admin/css/H-ui.admin.css" />-->
    <![endif]-->
    <title>信息录入</title>
</head>
<body>
<div class="contant">
<div class="row">
        <!--<div class="top">信息录入</div>-->
        <form id="registerForm" method="post" action="{:U('Apply/editBase')}" enctype="multipart/form-data" class="form-horizontal">
        <div class="content addapply">
            <div class="box larg-box">
                <h1>新增录入<span>(标*为必填项)</span></h1>
                <div class="list-block">
                    <div class="row form-group" >
                        <input id="status" type="hidden" name="check_status">
                        <input id="user_id" type="hidden" name="user_id" value={$userInfo.id}>
                        <label>姓名: <i class="required">*</i></label>
                        <input class="myCss col-sm-2" type="text" name="user_name" id="user_name" value={$userInfo.user_name}>
                        <label>身份证号: <i class="required">*</i></label>
                        <input id="identity_no" style="width: 200px;" class="myCss col-sm-2" type="text" name="identity_no" value={$userInfo.identity_no}>
                    </div>

                    <div class="row form-group">
                        <label>业务类型: <i class="required">*</i></label>
                        <select name="business_type">
                            <foreach name="businessTypes" item="val" >
                                <if condition="$key eq $carInfo['business_type']">
                                    <option value={$key} selected>{$val}</option>
                                    <else />
                                    <option value={$key}>{$val}</option>
                                </if>
                            </foreach>
                        </select>
                        <label>车辆性质：<i class="required">*</i> </label>
                        <select name="models_form">
                            <foreach name="carModelItems" item="val">
                                <if condition="$key eq $carInfo['models_form']">
                                    <option value={$key} selected>{$val}</option>
                                    <else />
                                    <option value={$key}>{$val}</option>
                                </if>
                            </foreach>
                        </select>
                        <label>上牌类型：<i class="required">*</i> </label>
                        <select name="license_type">
                            <foreach name="onCardItems" item="val">
                                <if condition="$key eq $carInfo['license_type']">
                                    <option value={$key} selected>{$val}</option>
                                    <else />
                                    <option value={$key}>{$val}</option>
                                </if>
                            </foreach>
                        </select>
                    </div>
                    <div class="row form-group">
                        <label>贷款银行: <i class="required">*</i></label>
                        <select name="loan_bank_id" style="width: 300px;">
                            <foreach name="bankList" item="ss" >
                                <if condition="$ss['id'] eq $userInfo['loan_bank_id']">
                                    <option value={$ss.id} selected>{$ss.bank_name}</option>
                                    <else />
                                    <option value={$ss.id}>{$ss.bank_name}</option>
                                </if>
                            </foreach>
                        </select>
                        <label>主贷人手机号: <i class="required">*</i></label>
                        <input id="telephone" class="myCss" type="text" name="telephone" value="{$userInfo.telephone}">
                    </div>
                    <div class="row">
                        <label>上传照片: <i class="required">*</i></label>
                        <label class="inputfile" for="">
                            <input class="upload" name="identity_photo_pros" accept="image/*" type="file" style="display: none"/><i>身份证正面</i>
                            <img class="pic" src="{$userInfo.identity_photo_pros}" >
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="identity_photo_cons" accept="image/*" type="file" style="display: none"/><i>身份证反面</i>
                            <img class="pic" src="{$userInfo.identity_photo_cons}" >
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="credit_authorize_photo" accept="image/*" type="file" style="display: none"/><i>提交征信授权书</i>
                            <img class="pic" src="{$userInfo.credit_authorize_photo}" >
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="credit_authorize_up" accept="image/*" type="file" style="display: none"/><i>征信授权书抬头照</i>
                            <img class="pic" src="{$userInfo.credit_authorize_up}" >
                        </label>
                        <!--<label class="inputfile" for="">-->
                            <!--<input class="upload" name="credit_authorize_down" accept="image/*" type="file" style="display: none"/><i>征信授权书低头照</i>-->
                            <!--<img class="pic" src="{$userInfo.credit_authorize_down}" >-->
                        <!--</label>-->
                        <label class="inputfile" for="">
                            <input class="upload" name="table_credit_photo" accept="image/*" type="file" style="display: none"/><i>征信表格照片</i>
                            <img class="pic" src="{$userInfo.table_credit_photo}" >
                        </label>
                    </div>
                    <div class="row">
                        <label>配偶姓名: <i class="required">*</i></label>
                        <input type="text" name="spouse_name" class="myCss col-sm-2" value="{$userInfo.spouse_name}">
                        <label>身份证号: <i class="required">*</i></label>
                        <input type="text" name="spouse_identity_no" style="width: 200px;" class="myCss col-sm-2" value="{$userInfo.spouse_identity_no}">
                    </div>
                    <div class="row">
                        <label>上传照片: <i class="required">*</i></label>
                        <label class="inputfile" for="">
                            <input class="upload" name="spouse_id_photo_pros" accept="image/*" type="file" style="display: none"/><i>身份证正面</i>
                            <img class="pic" src="{$userInfo.spouse_id_photo_pros}" >
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="spouse_id_photo_cons" accept="image/*" type="file" style="display: none"/><i>身份证反面</i>
                            <img class="pic" src="{$userInfo.spouse_id_photo_cons}" >
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="spouse_credit_photo" accept="image/*" type="file" style="display: none"/><i>提交征信授权书</i>
                            <img class="pic" src="{$userInfo.spouse_credit_photo}" >
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="spouse_credit_up" accept="image/*" type="file" style="display: none"/><i>征信授权书抬头照</i>
                            <img class="pic" src="{$userInfo.spouse_credit_up}" >
                        </label>
                    </div>
                </div>
            </div>
            <div class="box">
                <h1>操作</h1>
                <div class="list-block">
                    <input id="sub-frm" type="button" class="button01" value="提交" name="">
                    <input id="non-sub" type="button" class="button01" value="保存不提交" name="">
                </div>
            </div>
        </div>
        </form>
    </div>
</div>
<script type="text/javascript" src="__EXTEND__/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__EXTEND__/js/bootstrap.min.js"></script>
<script type="text/javascript" src="__EXTEND__/lib/layer/2.4/layer.js"></script>
<style type="text/css">
    i{cursor: pointer;}
   .pic{
        width:142px;
        height:120px;
        border-radius:0% ;
        cursor: pointer;
        background: #fff;
        /*position: absolute;
        */z-index: 1;
        }
</style>

<script type="text/javascript">
    $('#non-sub').click(function(){
        $('#status').val(-5);
        $('#registerForm').submit();
    });

    $('#sub-frm').click(function(){
        $('#status').val(-4);
        $('#registerForm').submit();
    });

    $(function() {
        $("i").click(function (elm) {

        $(this).siblings('.upload').click();//隐藏了input:file样式后，点击头像就可以本地上传
        $(this).siblings('.upload').on("change",function(){
            var objUrl = getObjectURL(this.files[0]) ; //获取图片的路径，该路径不是图片在本地的路径
            if (objUrl) {
            $(this).siblings('.pic').attr("src", objUrl) ; //将图片路径存入src中，显示出图片
            }
            });
        });
    });
     
    //建立一個可存取到該file的url
    function getObjectURL(file) {
        var url = null ;
        if (window.createObjectURL!=undefined) { // basic
        url = window.createObjectURL(file) ;
        } else if (window.URL!=undefined) { // mozilla(firefox)
        url = window.URL.createObjectURL(file) ;
        } else if (window.webkitURL!=undefined) { // webkit or chrome
        url = window.webkitURL.createObjectURL(file) ;
        }
        return url ;
    }
</script>
<!-- 上传插件 -->
<script src="__JS__/imgUp.js"></script>
</body>
</html>